import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import $ from "jquery";
// import Vant from "vant";
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/swiper-bundle.css'

import scrollShow from './config/scrollShow.js'
Vue.directive('scroll-show', scrollShow)

Vue.use(VueAwesomeSwiper)
// import "vant/lib/index.css";
// Vue.use(Vant);

import { Carousel, CarouselItem, Popover, Breadcrumb, BreadcrumbItem,Drawer,Collapse, CollapseItem,Rate } from "element-ui";
Vue.use(Carousel);
Vue.use(CarouselItem);
Vue.use(Popover);
Vue.use(Breadcrumb);
Vue.use(BreadcrumbItem);
Vue.use(Drawer);
Vue.use(Collapse);
Vue.use(CollapseItem);
Vue.use(Rate);

import less from "less";
Vue.use(less);

import store from "./store"; //Vuex仓库
import Vuex from "vuex";
Vue.use(Vuex);

import "./assets/css/styles.less"; //公共样式
import "./assets/css/pc.less"; //pc端样式
import "./assets/css/mobile.less"; //移动端样式

// 公共方法
import myFun from "./assets/js/utils";
Vue.prototype.myFun = myFun;

Vue.config.productionTip = false;

router.beforeEach((to, from, next) => {
  if (to.meta.title) {
    document.title = to.meta.title;
  }
  next();
});

// router.afterEach((to, from, next) => {
//   console.log(to.name);
//   if (to.name == "home") {
//     window.scrollTo(0, 0);
//   }
// });

new Vue({
  render: (h) => h(App),
  router,
  store,
}).$mount("#app");
